cmake_minimum_required(VERSION 3.17)
project(DataProxy)

set(CMAKE_CXX_STANDARD 17)

# Set Environment Variables
set(PROJECT_ROOT_PATH "${PROJECT_SOURCE_DIR}")
set(EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}/bin/")
set(LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/lib/")

# Copy Shared Lib
file(GLOB THIRDPARTY_SHARED_LIBS "${PROJECT_ROOT_PATH}/lib/shared_lib/*")
file(COPY ${THIRDPARTY_SHARED_LIBS} DESTINATION ${LIBRARY_OUTPUT_PATH})

# Copy Server File
file(GLOB SERVER_FILE "${PROJECT_ROOT_PATH}/serverFile/*")
file(COPY ${SERVER_FILE} DESTINATION ${PROJECT_BINARY_DIR}/serverFile)

# Set Link/Include Directories
link_directories(${PROJECT_BINARY_DIR}/lib/)
link_directories(${PROJECT_ROOT_PATH}/lib/static_lib)
include_directories(${PROJECT_ROOT_PATH}/include)

# Add Sub Directory
add_subdirectory(src)

add_executable(test test.cpp)
target_link_libraries(test ServerEndpoint ElasticsearchClient HBaseClient HdfsClient)

add_executable(main main.cpp)
target_link_libraries(main pistache ServerEndpoint)